package com.gzh.teaching.model.vo;

import com.gzh.core.util.NumericHelper;
import com.gzh.teaching.service.dto.SaveCommentIn;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class SaveCommentParam {
  private String workId;

  private String userId;

  private String score;

  private String comment;

  public SaveCommentIn paramToIn(Integer currentUserId) {
    SaveCommentIn in = new SaveCommentIn();
    in.setWorkId(NumericHelper.toInteger(this.workId));
    in.setUserId(NumericHelper.toInteger(this.userId));
    in.setScore(NumericHelper.toDouble(this.score));
    in.setComment(this.comment);
    return in;
  }
}
